package org.come.Jpanel;

import java.awt.*;

import javax.swing.*;

import com.tool.btn.FormsOnOffBtn;
import com.updateNew.MyIsif;

 

public class RolePetResistanceJpanel extends JPanel {

    // 几个属性分类面板
    private FaShuKangXingJpanel[] shuXingJpanel = new FaShuKangXingJpanel[5];

    public RolePetResistanceJpanel() throws Exception {
        if ("水墨UI".equals(MyIsif.getStyle())) {
//        this.setBackground(new Color(0, 0, 0, 0));
            this.setBackground(Color.BLACK);
            this.setLayout(null);
            int hight = 0;
            for (int i = 0; i < shuXingJpanel.length; i++) {
                shuXingJpanel[i] = new FaShuKangXingJpanel(i + 1);
                shuXingJpanel[i].setOpaque(false);
                shuXingJpanel[i].setBounds(0, hight, 300, 20);
                hight += shuXingJpanel[i].getHeight();
                this.add(shuXingJpanel[i]);
            }
            this.setPreferredSize(new Dimension(300, hight));
        } else {
            this.setBackground(Color.BLACK);
            this.setLayout(null);
            int hight = 0;
            for (int i = 0; i < shuXingJpanel.length; i++) {
                shuXingJpanel[i] = new FaShuKangXingJpanel(i + 1);
                shuXingJpanel[i].setOpaque(false);
                shuXingJpanel[i].setBounds(0, hight, 290, 24);
                hight += shuXingJpanel[i].getHeight();
                this.add(shuXingJpanel[i]);
            }
            this.setPreferredSize(new Dimension(290, hight));
        }

    }

    private ImageIcon icon;

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        if ("水墨UI".equals(MyIsif.getStyle())) {
            // 技能
            if (icon == null) {
                icon = new ImageIcon("inkImg/newbackground/S207.png");
            }

            g.drawImage(icon.getImage(), 0, 0, 300, 471, this);
        } else {
            // 技能
            if (icon == null) {
                icon = new ImageIcon("inkImg/hongmu/2/kx_zj.png");
            }

            g.drawImage(icon.getImage(), 0, 0, 290, 471, this);
        }

    }

    public FaShuKangXingJpanel[] getShuXingJpanel() {
        return shuXingJpanel;
    }

    public void setShuXingJpanel(FaShuKangXingJpanel[] shuXingJpanel) {
        this.shuXingJpanel = shuXingJpanel;
    }

}
